package psn.zjk;

import java.util.LinkedHashMap;
import java.util.Map.Entry;

public class LRUImpl extends LinkedHashMap<String, Object> {
	private int cap;

	public LRUImpl(int initialCapacity) {
		super(initialCapacity, 1, true);
		cap = initialCapacity;
	}

	@Override
	protected boolean removeEldestEntry(Entry<String, Object> eldest) {
		return size() > cap;
	}
}
